package com.tskj.leonsu.aop.dao;

import com.tskj.leonsu.db.DbUtilitys;
import com.tskj.leonsu.utility.Tools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class SysLogsDAO {

    @Autowired
    private DbUtilitys dbUtilitys;


    public void saveLog(Map<String, Object> params) throws Exception {
        String sql = "insert into order_log (ordertype,startdate,starttime,result,proceedtime,detail,createdate) " +
                "values (?, ?, ?, ?, ?, ?, now())";
        String orderType = params.get("ordertype").toString();
        String startDate = params.get("startdate").toString();
        String startTime = params.get("starttime").toString();
        String result = params.get("result").toString();
        String proceedTime = params.get("proceedtime").toString();
        String detail = params.get("detail").toString();
        dbUtilitys.execSQLWithTran(sql, orderType, startDate, startTime, result, proceedTime, detail);
    }
}
